"""
逻辑运算符：not，and，or
    1.运算结果也是bool类型
    2.
        not：逻辑非：其实就取反
            not True-->False
            not False-->True

        and：逻辑与，并且的意思：判定结果规则：如果都为真，结果才为真，如果一个一个为假，结果就为假。
            全真为真，一假则假。

        or：逻辑或，或者的意思：判定结果规则：有一个为真就为真，除非全为是假，结果才为假
            一真则真，全假为假
"""

# print(2 and 3)
# # print(2 and 5 or 3)
# # print(2 or 5 and 6)
# # print((2 or 5 )and 6)
# print(isinstance(True, int))
# print(isinstance(False, int))

a = True
b = False

print(not a)
print(not b)

print(not 4 > 5)

# and
print(a and 5 > 4)
print(a and 5 > 4 and 2 < 1)

# or

print(a and b)
print(a or b)

print(a or b or False)

print(not a or b or False)

print(not 3)
print(not 0)

print(True)
print(isinstance(True, bool))
print(isinstance(False, bool))
print('*' * 20)
print(isinstance(True, int))
print(isinstance(False, int))

print(3 and 5 and 7)
print(3 or 5 or 7)
print(3 or 5 and 7)
print((3 or 5) and 7)

print([] and 8)
print(None and 8)
print({} and 8)

print([] and 8)
print(None and 8)
print(0 and 9)
print(3 and 9 and {})
print('*' * 20, 'or-----')
print([] or 8)
print(None or 8)
print({} or 8)

# x + y